/*
 * @Author: yangni 920556271@qq.com
 * @Date: 2023-12-10 12:14:27
 * @LastEditors: yangni 920556271@qq.com
 * @LastEditTime: 2023-12-11 15:57:03
 * @FilePath: /yt-devops/lib/pages/site/site_observer_detail/views/observer_subtitle_widget.dart
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import 'package:flutter/cupertino.dart';
import 'package:yt_devops/components/log_utils.dart';
import 'package:yt_devops/components/yt_text_style.dart';
import 'package:yt_devops/styles/styles.dart';

class ObverserSubtitle extends StatelessWidget {
  final String title;
  final int isSelected;
  final Function() clickCallBack;
  const ObverserSubtitle(this.title, this.isSelected, this.clickCallBack,
      {Key? key})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    // Log.d('ObverserSubtitle===' + isSelected.toString());
    return GestureDetector(
      behavior: HitTestBehavior.opaque,
      onTap: () {
        clickCallBack();
      },
      child: Container(
        color: isSelected == 2 ? Colour.white : Colour.backgroundColor,
        padding: const EdgeInsets.only(left: 48),
        height: 40,
        alignment: Alignment.centerLeft,
        child: Text(title,
            style: ytTextStyle(
                fontSize: 14,
                color: isSelected == 2
                    ? Colour.primaryColor
                    : Colour.mainTextColor,
                fontWeight:
                    isSelected == 2 ? FontWeight.w500 : FontWeight.normal)),
      ),
    );
  }
}
